/**
 * @file mjnserver.cpp
 * @brief MahJong-Night server main function definition
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; version 3 of the License.
 *
 * @author VestniK (Sergey N.Vidyuk) sir.vestnik@gmail.com
 * @date 7 Jun 2008
 */
#include <QtCore/QCoreApplication>
#include <QtCore/QFile>
#include <QtCore/QDir>
#include <QtCore/QThread>

#include "server.h"
#include "logger.h"

using namespace mjn;

int main(int argc, char** argv) {
    QCoreApplication app(argc,argv);
    app.setOrganizationName("VestniK");
    app.setApplicationName("MahjongNightServer");

    QThread::currentThread()->setObjectName("main");
    QFile logFile(QDir::home().absoluteFilePath(".mjn-server.log"));
    logFile.open(QIODevice::WriteOnly | QIODevice::Truncate);
    log()->setDevice(&logFile);
    Server server;

    return app.exec();
}
